import { ApiProperty } from '@nestjs/swagger';
import { Column, Entity } from 'typeorm';
import { BaseEntity } from '../../../base.entity';

@Entity({ name: 'sys_menu' })
export default class SysMenu extends BaseEntity {
  @Column({ name: 'menu_id'})
  @ApiProperty()
  menuId: number;

  @Column({ name: 'parent_menu_id'})
  @ApiProperty()
  parentMenuId: number;

  @Column({ name: 'menu_code'})
  @ApiProperty()
  menuCode: string;

  @Column({ name: 'menu_name_zh'})
  @ApiProperty()
  menuNameZh: string;

  @Column({ name: 'menu_name_en'})
  @ApiProperty()
  menuNameEn: string;

  @Column({
    name:'menu_type',
    type: 'tinyint',
    width: 1,
    default: 0,
    comment: '类型: 0=目录 1=菜单 2=按钮',
  })
  @ApiProperty()
  menuType: number;

  @Column({nullable:true})
  @ApiProperty()
  url: string;
}
